## About
This is a POSIX compliant shell script for downloading and updating the Firefox `user.js` from [Privacy-Handbuch](https://www.privacy-handbuch.de/handbuch_21u.htm).

The script will download the `user.js` of your choice from privacy-handbuch into the selected profile directory. it is recommended to close Firefox and Thunderbird before changing their `user.js`es. Changes will take effect at the next start.


## Usage
After downloading `updater` you need to make the script executable first: `chmod +x updater`. You can either run it via `/path/to/updater` or put it in one of your `$PATH` directories to be able to just call `updater` (or whatever file name you have chosen).

If this script is **not** located in your user profile directory (which is e. g. `~/.mozilla/firefox/yourprofile.default`) you have to specify your profile directory with `-p PROFILE` or choose it from a list via `-l`.

The updater will search for a `user-overrides.js` in each selected profile directory and append it to the downloaded `user.js`. The options from `user-overrides.js` will take precedence over those from the `user.js`.

For automated updating you should at least use the option `-y` so the updater won't hang waiting for your confirmation. The option `-a` also comes in handy for automation. It will update every profile (Firefox & Thunderbird) in the default directory locations where a `user.js` from the Privacy-Handbuch is already present. Just make sure you got your `user.js` setup figured out beforehand. You might also let the updater update itself through the option `-u`.

#### Example usage
##### Manual updating:
```
updater -c moderat -p '/home/user/.mozilla/firefox/yourprofile.default'
```
This will install the *moderat* version of the `user.js` (`-c moderat`) to the specified profile directory (`-p`) and append the contents of `user-overrides.js` to the resulting `user.js` (default behavior).

##### Automatic updating of Firefox and Thunderbird `user.js`es (e. g. for cron.weekly):
```
/path/to/updater -aduy
```
This will create a diff file for later comparison of the current and older versions of the `user.js`es (`-d`), update the updater (`-u`) and update **all** recognized `user.js`es (`-a`) without asking for confirmation (`-y`). Since `-c` is not specified, each `user.js` will be updated to the latest version of their respective config. The `-p` option is most useful for setting all profiles up but not necessary in this "update everything" cronjob.


## Maintenance
Is this software still maintained?

Yes. There's not much to update, that's why the last commit might date back quite a while. Don't worry though, I will be notified of new issues.


## Acknowledgment
This script is based on the [ghacks (now known as arkenfox) `user.js` updater.sh](https://github.com/arkenfox/user.js/blob/master/updater.sh). Thanks for all your work!


## License
This software is licensed under the MIT License.
